/////////////////////////////////////////////////////////////////////////////
// Name:        downloadinipage.cpp
// Purpose:     
// Author:      yospaly
// Modified by: 
// Created:     05/01/2010 16:41:46
// RCS-ID:      
// Copyright:   Copyright (C) 2008, yospaly
// Licence:     
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "downloadinipage.h"
#include "inibuilder.h"

////@begin XPM images
////@end XPM images


/*!
 * DownloadIniPage type definition
 */

IMPLEMENT_DYNAMIC_CLASS( DownloadIniPage, wxWizardPageSimple )


/*!
 * DownloadIniPage event table definition
 */

BEGIN_EVENT_TABLE( DownloadIniPage, wxWizardPageSimple )

////@begin DownloadIniPage event table entries
    EVT_WIZARD_PAGE_CHANGED( -1, DownloadIniPage::OnDownloadiniPagePageChanged )

////@end DownloadIniPage event table entries

END_EVENT_TABLE()


/*!
 * DownloadIniPage constructors
 */

DownloadIniPage::DownloadIniPage()
{
    Init();
}

DownloadIniPage::DownloadIniPage( wxWizard* parent )
{
    Init();
    Create( parent );
}


/*!
 * DownloadIniPage creator
 */

bool DownloadIniPage::Create( wxWizard* parent )
{
////@begin DownloadIniPage creation
    wxBitmap wizardBitmap(wxNullBitmap);
    wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );

    CreateControls();
    if (GetSizer())
        GetSizer()->Fit(this);
////@end DownloadIniPage creation
    return true;
}


/*!
 * DownloadIniPage destructor
 */

DownloadIniPage::~DownloadIniPage()
{
////@begin DownloadIniPage destruction
////@end DownloadIniPage destruction
}


/*!
 * Member initialisation
 */

void DownloadIniPage::Init()
{
////@begin DownloadIniPage member initialisation
    p_download_ini_panel = NULL;
////@end DownloadIniPage member initialisation
}


/*!
 * Control creation for DownloadIniPage
 */

void DownloadIniPage::CreateControls()
{    
////@begin DownloadIniPage content construction
    DownloadIniPage* itemWizardPageSimple1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemWizardPageSimple1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW, 5);

    wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer3->Add(itemBoxSizer4, 1, wxALIGN_CENTER_VERTICAL, 5);

    wxStaticText* itemStaticText5 = new wxStaticText( itemWizardPageSimple1, wxID_STATIC, _("Progress"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText5->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma")));
    itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_LEFT|wxALL, 5);

    wxStaticText* itemStaticText6 = new wxStaticText( itemWizardPageSimple1, wxID_STATIC, _("This page displays the progress of the download or installation"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText6->Wrap(350);
    itemBoxSizer4->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT, 20);

    wxStaticBitmap* itemStaticBitmap7 = new wxStaticBitmap( itemWizardPageSimple1, wxID_STATIC, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer3->Add(itemStaticBitmap7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 20);

    wxStaticLine* itemStaticLine8 = new wxStaticLine( itemWizardPageSimple1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    itemBoxSizer2->Add(itemStaticLine8, 0, wxGROW|wxALL, 5);

    p_download_ini_panel = new DownloadIniPanel( itemWizardPageSimple1, ID_MIRRORLISTPANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    itemBoxSizer2->Add(p_download_ini_panel, 1, wxGROW|wxALL, 5);

////@end DownloadIniPage content construction
}


/*!
 * Should we show tooltips?
 */

bool DownloadIniPage::ShowToolTips()
{
    return true;
}

/*!
 * Get bitmap resources
 */

wxBitmap DownloadIniPage::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin DownloadIniPage bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end DownloadIniPage bitmap retrieval
}

/*!
 * Get icon resources
 */

wxIcon DownloadIniPage::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin DownloadIniPage icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end DownloadIniPage icon retrieval
}


/*!
 * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_DOWNLOADINI_PAGE
 */

void DownloadIniPage::OnDownloadiniPagePageChanged( wxWizardEvent& event )
{
    IniBuilder::get().parse();
}

